﻿//===========================================================================================ON LOAD

$(document).ready(function () {



    if (getParameterByName("category") == "student") {

        //Student
        $('#wizard').css("display", "block");
        $('#wizard').smartWizard();

        //Remove Others

        $('#wizard-teacher').remove();
        $('#wizard-parent').remove();
    }
    else {
        if (getParameterByName("category") == "teacher") {

            //Teacher
            $('#wizard-teacher').css("display", "block");
            $('#wizard-teacher').smartWizard();

            //Remove Others
            $('#wizard').remove();
            $('#wizard-parent').remove();
        }
        else {

            if (getParameterByName("category") == "parent") {

                //Parent
                $('#wizard-parent').css("display", "block");
                $('#wizard-parent').smartWizard();

                //Remove Others
                $('#wizard').remove();
                $('#wizard-teacher').remove();

            }
            else {

                window.location = "404-error.aspx";

            }


        }

    }

    // Initialize Smart Wizard




});



function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(window.location.search);
    if (results == null)
        return "";
    else
        return decodeURIComponent(results[1].replace(/\+/g, " "));
}







//===========================================================================================Student Registration






//===========================================================================================Teacher Registration
function DesignationChange() {
    if (document.getElementById("SelectDesignation").value == "New") {
        $("#txtNewDesignation").removeAttr("style");
    }
    else {
        $("#txtNewDesignation").css("display", "none");

    }
    $(".stepContainer").removeAttr("style");
}



function AssignSubjectsToTeacher() {
    
    var strOptions = "<a class='btn_no_text btn ui-state-default ui-corner-all tooltip' title='Remove' href='#'><span class='ui-icon ui-icon-circle-close'></span></a>";
    var SubjectName = "";
    SubjectName = $("#AssignSubject").val();



    $("#tblAssignedSubjectsToTeacher tbody").append("<tr>  <td>" + SubjectName + "</td> <td>" + strOptions + "</td></tr>");
    $(".stepContainer").removeAttr("style");
}


//===========================================================================================Parent Registration



function AssignStudentToParent() {

    var strOptions = "<a class='btn_no_text btn ui-state-default ui-corner-all tooltip' title='Remove' href='#'><span class='ui-icon ui-icon-circle-close'></span></a>";
    var SubjectName = "";
    SubjectName = $("#SelectStudent").val();



    $("#tblAssignStudentToParent tbody").append("<tr>  <td>" + SubjectName + "</td> <td>" + strOptions + "</td></tr>");
    $(".stepContainer").removeAttr("style");
}